Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(contracts): improve unit and e2e gas pump tests #1817

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

kevinhalliday
Copy link
Contributor

Improve unit and e2e gas pump tests.

Additional:

  • fix bug in OmniGasPump.quote()
  • use 10% toll

issue: #1686

@@ -161,7 +163,7 @@ contract OmniGasPump is XAppUpgradeable, OwnableUpgradeable, PausableUpgradeable
uint256 amtETH = _toEth(amtOMNI);

// "undo" toll
amtETH += (amtETH * TOLL_DENOM / (TOLL_DENOM - toll));
amtETH = (amtETH * TOLL_DENOM / (TOLL_DENOM - toll));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was bug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bye bug

@@ -161,7 +163,7 @@ contract OmniGasPump is XAppUpgradeable, OwnableUpgradeable, PausableUpgradeable
uint256 amtETH = _toEth(amtOMNI);

// "undo" toll
amtETH += (amtETH * TOLL_DENOM / (TOLL_DENOM - toll));
amtETH = (amtETH * TOLL_DENOM / (TOLL_DENOM - toll));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bye bug


// assert quoted and actual within 10 wei of each other
// allows for rounding errors in different between taking / undoing toll
_assertWithinEpisilon(dryRunOMNI, targetOMNI, 10);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_assertWithinEpisilon(dryRunOMNI, targetOMNI, 10);
_assertWithinEpsilon(dryRunOMNI, targetOMNI, 10);

Improve unit and e2e gas pump tests.

Fix bug in OmniGasPump.quote()
@kevinhalliday kevinhalliday merged commit 3aa651e into main Sep 11, 2024
18 checks passed
@kevinhalliday kevinhalliday deleted the kh/better-gaspump-tests branch September 11, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants